import request from "/@/utils/request"
//获取建筑名称
// export function getAllBuildings(obj) {
//   return request({
//     url: '/bm/bamsbuildings/getBamSBuildingsBy',
//     method: 'post',
//     data: obj
//   })
// }
// 获取建筑名称
export function getAllBuildings(query) {
  return request({
    url: '/admin/accessBuildings/page',
    method: 'get',
    params: query
  })
}
//自动生成编号
export function getBamSubareaCode(obj) {
  return request({
    url: '/bm/bamssubarea/getBamSubareaCode',
    method: 'get',
    params: obj
  })
}
//获取所有的楼层
// export function getAllFloor(query) {
//   return request({
//     url: '/bm/bamsfloor/getBamFloorBy',
//     method: 'post',
//     data: query
//   })
// }
export function getAllFloor(query) {
  return request({
    url: '/admin/accessFloor/page',
    method: 'get',
    params: query
  })
}
// 获取关联设备列表
export function fetchList(query) {
  return request({
    url: '/em/deviceinfo/page',
    method: 'get',
    params: query
  })
}
// 获取列表
export function getlistData(query) {
  return request({
    url: '/om/ominspectionList/page',
    method: 'get',
    params: query
  })
}
// 新增
export function addObj(obj) {
  return request({
    url: '/om/ominspectionList',
    method: 'post',
    data: obj
  })
}
// 删除
export function delObj(id) {
  return request({
    url: '/om/ominspectionList/' + id,
    method: 'delete'
  })
}
// 修改
export function putObj(obj) {
  return request({
    url: '/om/ominspectionList',
    method: 'put',
    data: obj
  })
}
// 自动获取巡检编码
export function getCode(query) {
  return request({
    url: '/om/ominspectionList/getCode/'+ query,
    method: 'get',    
  })
}
//批量删除
export function delAllObj(obj) {
  return request({
    url: '/om/ominspectionList/deleteIds',
    method: 'delete',
    data: obj
  })
}
// 获取分区名称数据
export function getNameList(query) {
  return request({
    // url: '/bm/bamssubarea/page',
    url: '/admin/accessSubarea/page',
    method: 'get',
    params: query
  })
}

export function getOminspectionList(query){
  return request({
    url:'/om/ominspection/page',
    method:'get',
    params:query
  })
}